# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

  $MODAL_CONTAINER = "modal_container"
  $MODAL_BOX = "modal_box"
  $MODAL_HEADER = "modal_header"

  def modal_box(box_content = "")
    close_modal_link = button_to_function "X", "closeModal()", :class => "modal_button"
    header = content_tag "div", close_modal_link << "<div>Create Mapping</div>", :id => $MODAL_HEADER
    content_tag "div", header << box_content, :id => $MODAL_BOX
  end

  def pretty_time(time)
    time.strftime("%b %d, %Y %I:%M%p") if !time.nil?
  end
  
end
